package com.itheima.demo;

import com.github.pagehelper.PageInfo;
import com.itheima.pojo.User;
import com.itheima.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class Demo2 {
    public static void main(String[] args) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("spring.xml");
        UserService userService = ac.getBean(UserService.class);
       /* User one = userService.findOne(4);
        System.out.println(one);*/

        List<User> userList = userService.findAll();
        PageInfo<User> userPageInfo = new PageInfo<>(userList);
        System.out.println(userPageInfo);
    }
}
